﻿using ReflectionStudio.Components.UserControls;
using ReflectionStudio.Core.Events;
using System;
using System.ComponentModel;
using System.Data;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
namespace WPFExcelReport
{
    public partial class MainWindow : DocumentBase
    {  
        public ApplicationBase app
        {
            get
            {
                return ApplicationBase.Instance;
            }
        }
        public MainWindow()
        { 
            InitializeComponent();
        }
       
        MessageInfo msg;
        ViewBase ui;
        public override void OnWorkflowIDChange(MessageEventArgs e)
        {
            base.OnWorkflowIDChange(e);
            string wfid = e.Info.Details;
            msg = e.Info;
            MainTab.Children.Clear();
            switch (wfid)
            {
                case "VA09":
                    this.Name = "色号管理"; 
                    ui = new TFVA10();
                  switch(app.company)
                    {
                        default:
                            ((TFVA10)ui).IsWS15 = true;
                            break;
                        case "TST":
                            ((TFVA10)ui).IsWS15 = false;
                            break; 
                    }
                    ui.EXAUF = msg.ORDER;
                    MainTab.Children.Add(ui); 
                    break;
                case "VAFTXT":
                    this.Name = "公司评定"; 
                    ui = new TVAFSWTXT();
                    ui.ORDERNUM = msg.ART;
                    MainTab.Children.Add(ui);
                    break;
            }
        }
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {  
        }  
    }
}
